﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XDL.Framework;
using Microsoft.Xna.Framework;

namespace JumpNFight.Simulation
{
    class Crate
    {
        BoundingBox m_bbox = new BoundingBox();
        Vector2i m_position = Vector2i.Zero;
        /// <summary>
        /// Identifies a hit with the crate object
        /// </summary>
        public const int HitEvent = 3001;
        public Vector2i Tile
        {
            get
            {
                return m_position;
            }
            set
            {
                m_position = value;
                // update bounding box
                m_bbox.Min = new Vector3(m_position.X * World.UnitToPixel, m_position.Y * World.UnitToPixel, 0);
                m_bbox.Max = new Vector3((m_position.X + 1) * World.UnitToPixel, (m_position.Y + 1) * World.UnitToPixel, 0);
            }
        }

        public bool Intersects(Moveable other)
        {
            return other.Intersects(m_bbox);
        }

        public Crate()
        {
        }
    }
}
